Question: Let $P(x)$ be a polynomial such that
\[P(x) = P(0) + P(1) x + P(2) x^2\]and $P(-1) = 1.$  Find $P(x).$
Answer: Setting $x = -1,$ $x = 1,$ and $x = 2,$ we get
\begin{align*}
1 = P(-1) &= P(0) - P(1) + P(2), \\
P(1) &= P(0) + P(1) + P(2), \\
P(2) &= P(0) + 2P(1) + 4P(2),
\end{align*}respectively.  Solving this as a system of equations in $P(0),$ $P(1),$ and $P(2),$ we get $P(0) = -1,$ $P(1) = -1,$ and $P(2) = 1,$ so
\[P(x) = \boxed{x^2 - x - 1}.\]